<template lang="pug">
  .clearfix
    Modal(
      width="300"
      v-model="isShowReNameModal"
      title="输入新的文件名"
      class-name="vertical-center-modal"
    )
      Input(type="text" v-model="currentNewName")

      .clearfix(slot="footer")
        Button(type="text" @click="cancel") 取消
        Button(type="primary" @click="handleSubmit") 确定
</template>

<script>
import { PolicySupportApi } from '@/api/PolicySupport.api.js'
export default {
  name: '',

  props: {
  },

  data () {
    return {
      isShowReNameModal: false,
      currentNewName: ''
    }
  },

  watch: {
  },

  mounted () {
  },

  methods: {
    cancel () {
      this.isShowReNameModal = false
    },

    handleSubmit () {
      if (this.currentNewName) {
        this.isShowReNameModal = false
        this.$emit('handleSubmit', this.currentNewName)
      } else {
        this.$Message.error({
          content: '请输入新文件名',
          duration: 10,
          closable: true
        })
      }
    }
  }
}
</script>

<style lang="less" scope>
</style>
